// const Mock = require('mockjs')

const List = [{
    id: 1,
    title: '首页',
    isdefault: 1,
    type: 'index',
    created_time: '2021-1-30',
    updated_time: '2021-1-30'
},
{
    id: 2,
    title: '演示列表',
    isdefault: 0,
    type: 'common',
    created_time: '2021-1-30',
    updated_time: '2021-1-30'
}]

module.exports = [
    {
        url: '/vue-element-admin/renovation/mobile/list',
        type: 'get',
        response: config => {
            const { page = 1, limit = 20 } = config.query
            const mockList = List
            const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))

            return {
                code: 20000,
                data: {
                    total: mockList.length,
                    items: pageList
                }
            }
        }
    },
    {
        url: '/vue-element-admin/renovation/mobile/create',
        type: 'post',
        response: _ => {
            return {
                code: 20000,
                data: 'success'
            }
        }
    },

    {
        url: '/vue-element-admin/renovation/mobile/update',
        type: 'post',
        response: _ => {
            return {
                code: 20000,
                data: 'success'
            }
        }
    },
    {
        url: '/vue-element-admin/renovation/mobile/delete',
        type: 'post',
        response: _ => {
            return {
                code: 20000,
                data: 'success'
            }
        }
    },

    {
        url: '/vue-element-admin/renovation/pc/list',
        type: 'get',
        response: config => {
            const { page = 1, limit = 20 } = config.query
            const mockList = List
            const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))

            return {
                code: 20000,
                data: {
                    total: mockList.length,
                    items: pageList
                }
            }
        }
    },
    {
        url: '/vue-element-admin/renovation/pc/create',
        type: 'post',
        response: _ => {
            return {
                code: 20000,
                data: 'success'
            }
        }
    },

    {
        url: '/vue-element-admin/renovation/pc/update',
        type: 'post',
        response: _ => {
            return {
                code: 20000,
                data: 'success'
            }
        }
    },
    {
        url: '/vue-element-admin/renovation/pc/delete',
        type: 'post',
        response: _ => {
            return {
                code: 20000,
                data: 'success'
            }
        }
    }
]

